package 遍历;

//正向，反向遍历数组

public class test01 {
    public static void main(String[] args) {
        //正向遍历   快捷键：arr.fori+回车
        int[] arr1 = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        for (int i = 0; i < arr1.length; i++) {
            System.out.println(arr1[i]);
            System.out.println("..............");
            //反向遍历  快捷键：arr.forr+回车
            int[] arr2 = {1, 2, 3, 4, 5, 6, 7, 8, 9};
            for (int x = arr2.length - 1; x >= 0; x--) {
                System.out.println(arr1[x]);


                int[] arr3 = {1, 1, 1, 1};
                for (int p = 0; p < arr3.length; p++) {
                    System.out.println(arr3[p]);

                    int[] arr4 = {5, 6, 7};
                    for (int q = arr4.length - 1; q >= 0; q--) {
                        System.out.println(arr4[q]);
                    }

                }

            }


        }
    }
}